import React, { useEffect } from 'react';
//访客新老客户分布比例图
import * as echarts from 'echarts';
import '../sacc/Pie.scss'
const Pie = () => {
    useEffect(() => {
        var option = echarts.init(document.getElementById('pie') || document.body)
        option.setOption({
            title: {
                text: '访客新老客户分布比例图',
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            legend: {
                bottom: 10,
                left: 'center',
                data: ['新客户', '游客', '老客户']

            },
            series: [
                {
                    type: 'pie',
                    radius: '65%',
                    center: ['43%', '50%'],
                    selectedMode: 'single',
                    data: [
                        { value: 735, name: '老客户' },
                        { value: 434, name: '游客' },
                        { value: 335, name: '新客户' }
                    ]

                }
            ],
        })

    }, [])
    return (
        <div>
            <div id='pie'>
            </div>
        </div>
    )
}

export default Pie;